<script src="__PUBLIC__/ganged/Js/city-picker.data.js"></script>
<script src="__PUBLIC__/ganged/Js/city-picker.js"></script>
<script src="__PUBLIC__/ganged/Js/main.js"></script>
<!-- css -->
<link href="__PUBLIC__/ganged/Css/city-picker.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/js/uploadify/jquery.uploadify.min.js" ></script>
<link rel="stylesheet" charset="utf-8" type="text/css" href="__PUBLIC__/admin/js/uploadify/uploadify.css"> 
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/js/upload.js" ></script>
<div class="container" style="padding-top: 50px;">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <form class="form-horizontal" role="form" id="post_form" action="{:U('')}">
                <div class="form-group">
                    <label for="name" class="col-sm-2 control-label">名称:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="name" value="{$info['name']|default=''}" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="mobile" class="col-sm-2 control-label">手机号:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="mobile" value="{$info['mobile']|default=''}"  />
                    </div>
                </div>
                <div class="form-group">
                    <label for="img" class="col-sm-2 control-label">图片(309x280):<span style="color: red;">*</span></label>
                    <div class="col-sm-9 js_upload_img">
                        <input type="file" class="form-control" id="img" value="{$info.img}"><br /> 
                        <div name="img" class="upviewer">
                            <ul>
                                <notempty name="info['img']">
                                    <li>
                                        <input type="hidden" name="img[]" value="{$info.img}">
                                        <img src="{$info.img}"/><a d_path="{$info.img}">删除</a>
                                    </li>
                                </notempty>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="ds" class="col-sm-2 control-label">城市:<span style="color: red;">*</span></label>
                    <div id="distpicker" style="margin-left:20%">
                        <div class="form-group">
                            <div style="position: relative;">
                                <input class="form-control" name="city" readonly type="text" value="{$info['city']|default=''}" data-toggle="city-picker" style="width:400px;">
                            </div>
                        </div>
                        <div class="form-group">
                            <button class="btn btn-warning" id="reset" type="button">重置</button>
                            <button class="btn btn-danger" id="destroy" type="button">确定</button>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="address" class="col-sm-2 control-label">地址:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="address" value="{$info['address']|default=''}" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="age" class="col-sm-2 control-label">年龄:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="age" id="age" value="{$info['age']|default=''}" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="seniority" class="col-sm-2 control-label">资历:</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="seniority" value="{$info['seniority']|default=''}" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="shanchang" class="col-sm-2 control-label">擅长领域:</label>
                    <div class="col-sm-9">
                        <textarea class="form-control" name="shanchang" rows="3">{$info['shanchang']|default=''}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label for="interview_money" class="col-sm-2 control-label">面对面咨询费用:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <input type="number" min="0"  class="form-control" name="interview_money" value="{$info['interview_money']|default=''}" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="voice_money" class="col-sm-2 control-label">语音咨询费用:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <input type="number" min="0"  class="form-control" name="voice_money" value="{$info['voice_money']|default=''}" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="sort" class="col-sm-2 control-label">排序:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <input type="number" min="0"  class="form-control" name="sort" value="{$info['sort']|default=''}" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="status" class="col-sm-2 control-label">状态:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <label class="radio-inline">
                            <input type="radio" name="status" checked value="1">开启
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="status" value="0">关闭
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <input type="hidden" name="id" value="{$info.id}">
                        <button type="button" class="btn btn-primary" id="btn" lng="0" lat="0">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    $(function () {
        $("#btn").click(function () {
            var $form = $("#post_form");
            var $data = {};
            var $form_data = $form.serializeArray();
            $.each($form_data, function (k, v) {
                $data[v.name] = v.value;
            });
            $.post($form.attr('action'), $data, function (obj) {
                alert(obj.m);
                if (obj.s) {
                    if (typeof (obj.url) != "undefined" && obj.url) {
                        location.href = obj.url;
                    }
                }
            });
            return false;
        });
    });
</script>